<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Track Fitting: Main Page</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Track Fitting
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">Track Fitting Documentation</div>  </div>
</div>
<div class="contents">
<div class="textblock"><h2><a class="anchor" id="files"></a>
Primary files</h2>
<ul>
<li>
<a class="el" href="fit__track_8m.html#a88f7b8832262ec26caa76ab3b06972bd" title="Given an initial set of parameters, generates one track.">fit_track()</a> <p>Given an initial set of parameters, generates one track. </p>
 </li>
<li>
<a class="el" href="grad__tracks_8m.html#aa13024e1f228a8bb260dab58e7acb874" title="Small script for selecting points at the top frame of a 2D time series tif.">grad_tracks()</a> <p>Small script for selecting points at the top frame of a 2D time series tif. </p>
 </li>
</ul>
<h2><a class="anchor" id="algo"></a>
Algorithm</h2>
<p>The main algorithm can be found in <a class="el" href="fit__track_8m.html#a88f7b8832262ec26caa76ab3b06972bd" title="Given an initial set of parameters, generates one track.">fit_track()</a>: <p>Given an intial x-y coordinate, image, and delta (pixel radius) fitTrack will: </p>
<ol>
<li>
Mark the current pixel </li>
<li>
Obtain a <img class="formulaInl" alt="$ 2 \delta x 2 \delta $" src="form_0.png"/> sub-image of the next frame centered at the current frame's blob coordinates </li>
<li>
Calculate <img class="formulaInl" alt="$ max\_pixel(\sqrt{(\nabla_{x}(sub-image))^{2} + (\nabla_{y}(sub-image))^{2}}) $" src="form_1.png"/> </li>
<li>
Assign the current pixel to the closest max pixel from the previous calculation </li>
<li>
Repeat </li>
</ol>
<p>The algorithm state is maintained by the following variables: </p>
<ul>
<li>
z_curr - current frame or stack index </li>
<li>
row_curr - current row index (m) </li>
<li>
col_curr - current column index (n) </li>
</ul>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">img</td><td>three dimensional (M,N,Z) binary image, third dimension represents time </td></tr>
    <tr><td class="paramname">row</td><td>row coordinate of starting pixel from img(:,:,Z) </td></tr>
    <tr><td class="paramname">col</td><td>column coordinate of starting pixel from img(:,:,Z) </td></tr>
    <tr><td class="paramname">z_init</td><td>initialization frame, allows the track to start at any level </td></tr>
    <tr><td class="paramname">delta</td><td><img class="formulaInl" alt="$ \delta $" src="form_2.png"/> (radius) for sub-image </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">img_out</td><td>A 3D image with only one track. </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="obsv"></a>
Observations</h2>
<p>A realistic <img class="formulaInl" alt="$ \delta $" src="form_2.png"/> would be <img class="formulaInl" alt="$ \frac{\lambda}{pixel\;callibration} $" src="form_8.png"/>, but this causes points in neighboring pixels to quickly converge to the same 'track'.<br/>
 This problem can be seen especially when dealing with simulated data. So a smaller window will get the best isolated tracks, but appear somewhat less stable and may not be realistic. </p>
</div></div>


<hr class="footer"/><address class="footer"><small>
Generated on Wed Sep 28 2011 02:36:57 for Track Fitting by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
